<div class="pageBtn">
#if(totalPages>1)    
    #if(hasPrevious)
        <a href="#(pattern)#(previousPageNumber)" class="page_prev">Previous</a>
    #else
        <a href="javascript:;" class="page_prev on">Previous</a>
    #end
    #for(segmentPageNumber : segment)
        #if(segmentPageNumber != pageNumber)
            <a href="#(pattern)#(segmentPageNumber)">#(segmentPageNumber)</a>
        #else
            <a href="javascript:;" class="page_num on">#(segmentPageNumber)</a>
        #end
    #end
    #if(hasNext)
        <a href="#(pattern)#(nextPageNumber)" class="page_next">Next</a>
    #else
        <a href="javascript:;" class="page_next on">Next</a>
    #end
#end 
</div>